1. Field of the Invention
The present invention relates to techniques for reusing execution results of subclass test functions in execution environments of dynamic programming languages. More particularly, the present invention relates to a technique for optimizing a program by efficiently and securely reusing profiled execution results of subclass test functions.
2. Description of Related Art
In object-oriented languages, subclass test functions for testing whether an object is an instance of a class or an instance of a subclass of a class are often used. As such subclass test functions, the “instanceof” operator in Java® programming language and the “isinstance” function in Python, for example, are known. These subclass test functions are used when different processes are performed for individual classes in normal operations and exception handling.
The frequency in use of subclass test functions is high but the subclass test functions have a high check cost, which is a problem. Accordingly, regarding subclass test functions whose operations are uniquely decided by the language specifications, such as the “instanceof” operator in Java®, optimization approaches for simply caching results of tests conducted in the past and using the cached test results have been hitherto adopted (see, for example, Japanese Unexamined Patent Application Publication No. 2000-39997 and U.S. Pat. No. 7,266,813).
In addition, several patent literatures disclose other techniques for checking types of objects. U.S. Pat. No. 7,080,354 discloses the following technique: A virtual dynamic type check (DTC) function is generated for each object at run time. The virtual DTC function contains a sequence of instructions to type-check every element within an object type hierarchy. The virtual DTC function conducts dynamic type checking more efficiently for objects of a particular type for which the virtual DTC function is tailored.
U.S. Pat. No. 7,007,030 discloses, as a method for representing a dataset having a plurality of elements characterized by a plurality of relations, a technique for assigning an identifier and an interval to each of the plurality of elements. The interval represents at least one relation of the element to at least one element of the plurality of elements.
Japanese Unexamined Patent Application Publication No. 2003-186675 discloses a technique for implementing, as an array of class references, a Java® class hierarchy which represents the hierarchical relationship of parent classes of a Java® class. The array of class references is used to efficiently perform type checking in Java® computing environments.
U.S. Pat. No. 7,216,333 discloses a technique for tracking superclasses of a class by using a subclass fingerprint and tracking locally declared interfaces of the class by using an interface fingerprint.